import * as actionTypes from './constants'

const initialState = {
  count: 100,
}

 function reducer(state = initialState, action) {
  switch (action.type) {
    case actionTypes.INCREASE_COUNT:
      return { ...state, count: state.count + action.value }
    case actionTypes.DECREASE_COUNT:
      return { ...state, count: state.count - action.value }
    default:
      return state
  }
 }

 export default reducer